package com.bailan.foreat.mapper;

import com.bailan.foreat.entity.ProductType;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ste
 * @since 2023-02-21 07:50:43
 */
@Mapper
public interface ProductTypeMapper extends BaseMapper<ProductType> {


    @Select("SELECT id,type_name as typeName FROM t_product_type WHERE id in\n" +
            "            (select type_id from t_protype where product_id in (SELECT id  from t_product WHERE store_id=#{storeId} and status=0))")
    List<ProductType> queryByStoreId(Integer storeId);

}
